Don't mock what you don't own
https://github.com/testdouble/contributing-tests/wiki/Don't-mock-what-you-don't-own
What you should do instead
For instance, if you depend on an HTTP library for which each use looks like:
Instead you might introduce your own wrapper: (コード略) And then fake that wrapper instead.
That's Not Yours